.class public Lcom/teewoo/app/bus/ui/SystemActivity;
.super Lcom/teewoo/app/bus/inface/BaseActivity;
.source "SystemActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/teewoo/app/bus/ui/SystemActivity$MenuListAdapter;
    }
.end annotation


# instance fields
.field private menuListAdapter:Lcom/teewoo/app/bus/ui/SystemActivity$MenuListAdapter;

.field private menuListView:Landroid/widget/ListView;

.field private menus:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 33
    invoke-direct {p0}, Lcom/teewoo/app/bus/inface/BaseActivity;-><init>()V

    .line 34
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menus:Ljava/util/ArrayList;

    .line 33
    return-void
.end method

.method static synthetic access$0(Lcom/teewoo/app/bus/ui/SystemActivity;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 34
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menus:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$1(Lcom/teewoo/app/bus/ui/SystemActivity;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 174
    invoke-direct {p0}, Lcom/teewoo/app/bus/ui/SystemActivity;->parseVersion()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$2(Lcom/teewoo/app/bus/ui/SystemActivity;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 200
    invoke-direct {p0}, Lcom/teewoo/app/bus/ui/SystemActivity;->getSystemVersion()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$3(Lcom/teewoo/app/bus/ui/SystemActivity;Ljava/lang/String;Ljava/lang/String;)Z
    .locals 1
    .parameter
    .parameter
    .parameter

    .prologue
    .line 157
    invoke-direct {p0, p1, p2}, Lcom/teewoo/app/bus/ui/SystemActivity;->shouldUpdate(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method static synthetic access$4(Lcom/teewoo/app/bus/ui/SystemActivity;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 33
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->context:Landroid/content/Context;

    return-object v0
.end method

.method private getSystemVersion()Ljava/lang/String;
    .locals 6

    .prologue
    .line 202
    const-string v2, ""

    .line 203
    .local v2, version:Ljava/lang/String;
    iget-object v3, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->context:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v3

    .line 204
    const/4 v4, 0x0

    invoke-virtual {v3, v4}, Landroid/content/pm/PackageManager;->getInstalledPackages(I)Ljava/util/List;

    move-result-object v1

    .line 205
    .local v1, packages:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/PackageInfo;>;"
    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_0
    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_1

    .line 210
    return-object v2

    .line 205
    :cond_1
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/PackageInfo;

    .line 206
    .local v0, packageInfo:Landroid/content/pm/PackageInfo;
    iget-object v4, v0, Landroid/content/pm/PackageInfo;->packageName:Ljava/lang/String;

    const-string v5, "com.teewoo.app.bus"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 207
    iget-object v2, v0, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;

    goto :goto_0
.end method

.method private parseVersion()Ljava/lang/String;
    .locals 11

    .prologue
    .line 175
    const-string v6, ""

    .line 178
    .local v6, version:Ljava/lang/String;
    :try_start_0
    const-string v8, "http://doudou360.com/Android.htm"

    invoke-static {v8}, Lcom/teewoo/app/bus/util/WebUtils;->getHtmlPage(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 180
    .local v1, htmlSource:Ljava/lang/String;
    invoke-static {v1}, Lcom/teewoo/app/bus/util/WebUtils;->getVersion(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    .line 182
    .local v7, versiontext:Ljava/lang/String;
    const-string v4, ".*?"

    .line 183
    .local v4, re1:Ljava/lang/String;
    const-string v5, "((?:[a-z][a-z\\.\\d_]+)\\.(?:[a-z\\d]{3}))(?![\\w\\.])"

    .line 185
    .local v5, re2:Ljava/lang/String;
    new-instance v8, Ljava/lang/StringBuilder;

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v8, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    const/16 v9, 0x22

    invoke-static {v8, v9}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;I)Ljava/util/regex/Pattern;

    move-result-object v3

    .line 187
    .local v3, p:Ljava/util/regex/Pattern;
    invoke-virtual {v3, v7}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v2

    .line 188
    .local v2, m:Ljava/util/regex/Matcher;
    invoke-virtual {v2}, Ljava/util/regex/Matcher;->find()Z

    move-result v8

    if-eqz v8, :cond_0

    .line 189
    const/4 v8, 0x1

    invoke-virtual {v2, v8}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/String;->toString()Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v6

    .line 196
    .end local v1           #htmlSource:Ljava/lang/String;
    .end local v2           #m:Ljava/util/regex/Matcher;
    .end local v3           #p:Ljava/util/regex/Pattern;
    .end local v4           #re1:Ljava/lang/String;
    .end local v5           #re2:Ljava/lang/String;
    .end local v7           #versiontext:Ljava/lang/String;
    :cond_0
    :goto_0
    const/16 v8, 0x9

    invoke-virtual {v6}, Ljava/lang/String;->length()I

    move-result v9

    const/4 v10, 0x4

    sub-int/2addr v9, v10

    invoke-virtual {v6, v8, v9}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v8

    return-object v8

    .line 191
    :catch_0
    move-exception v8

    move-object v0, v8

    .line 192
    .local v0, e:Ljava/lang/Exception;
    iget-object v8, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->context:Landroid/content/Context;

    const v9, 0x7f080017

    invoke-static {v8, v9}, Lcom/teewoo/app/bus/util/ToastUtil;->showToastCenter(Landroid/content/Context;I)V

    .line 193
    const-string v8, "version check"

    const-string v9, "get the load version failure."

    invoke-static {v8, v9}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method private shouldUpdate(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 9
    .parameter "loadVersion"
    .parameter "sysVersion"

    .prologue
    const/4 v8, 0x4

    const/4 v7, 0x2

    const/4 v6, 0x0

    .line 158
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v4

    const/4 v5, 0x5

    if-eq v4, v5, :cond_0

    .line 159
    iget-object v4, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->context:Landroid/content/Context;

    const v5, 0x7f08005b

    invoke-static {v4, v5}, Lcom/teewoo/app/bus/util/ToastUtil;->showToastCenter(Landroid/content/Context;I)V

    move v4, v6

    .line 171
    :goto_0
    return v4

    .line 163
    :cond_0
    new-instance v2, Ljava/lang/StringBuffer;

    invoke-direct {v2}, Ljava/lang/StringBuffer;-><init>()V

    .line 164
    .local v2, ver_load:Ljava/lang/StringBuffer;
    invoke-virtual {p1, v6}, Ljava/lang/String;->charAt(I)C

    move-result v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {p1, v7}, Ljava/lang/String;->charAt(I)C

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {p1, v8}, Ljava/lang/String;->charAt(I)C

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 165
    new-instance v4, Ljava/lang/Integer;

    invoke-virtual {v2}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/Integer;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v0

    .line 167
    .local v0, loadVerNum:I
    new-instance v3, Ljava/lang/StringBuffer;

    invoke-direct {v3}, Ljava/lang/StringBuffer;-><init>()V

    .line 168
    .local v3, ver_sys:Ljava/lang/StringBuffer;
    invoke-virtual {p2, v6}, Ljava/lang/String;->charAt(I)C

    move-result v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {p2, v7}, Ljava/lang/String;->charAt(I)C

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {p2, v8}, Ljava/lang/String;->charAt(I)C

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 169
    new-instance v4, Ljava/lang/Integer;

    invoke-virtual {v3}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/Integer;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v1

    .line 171
    .local v1, sysVerNum:I
    if-le v0, v1, :cond_1

    const/4 v4, 0x1

    goto :goto_0

    :cond_1
    move v4, v6

    goto :goto_0
.end method


# virtual methods
.method public initialUI()V
    .locals 2

    .prologue
    .line 39
    invoke-super {p0}, Lcom/teewoo/app/bus/inface/BaseActivity;->initialUI()V

    .line 40
    sget-object v0, Lcom/teewoo/app/bus/ui/SystemActivity;->cityView:Landroid/widget/TextView;

    sget-object v1, Lcom/teewoo/app/bus/ui/Home4StaticMap;->currentCityAddress:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 41
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menus:Ljava/util/ArrayList;

    const v1, 0x7f080078

    invoke-virtual {p0, v1}, Lcom/teewoo/app/bus/ui/SystemActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 42
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menus:Ljava/util/ArrayList;

    const v1, 0x7f080079

    invoke-virtual {p0, v1}, Lcom/teewoo/app/bus/ui/SystemActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 43
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menus:Ljava/util/ArrayList;

    const v1, 0x7f08007a

    invoke-virtual {p0, v1}, Lcom/teewoo/app/bus/ui/SystemActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 44
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menus:Ljava/util/ArrayList;

    const v1, 0x7f08007b

    invoke-virtual {p0, v1}, Lcom/teewoo/app/bus/ui/SystemActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 45
    const v0, 0x7f0a0027

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/SystemActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menuListView:Landroid/widget/ListView;

    .line 46
    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 2
    .parameter "savedInstanceState"

    .prologue
    .line 50
    invoke-super {p0, p1}, Lcom/teewoo/app/bus/inface/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    .line 51
    const v0, 0x7f030026

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/SystemActivity;->setContentView(I)V

    .line 52
    iput-object p0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->context:Landroid/content/Context;

    .line 53
    invoke-virtual {p0}, Lcom/teewoo/app/bus/ui/SystemActivity;->initialUI()V

    .line 55
    new-instance v0, Lcom/teewoo/app/bus/ui/SystemActivity$MenuListAdapter;

    invoke-direct {v0, p0, p0}, Lcom/teewoo/app/bus/ui/SystemActivity$MenuListAdapter;-><init>(Lcom/teewoo/app/bus/ui/SystemActivity;Landroid/content/Context;)V

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menuListAdapter:Lcom/teewoo/app/bus/ui/SystemActivity$MenuListAdapter;

    .line 56
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menuListView:Landroid/widget/ListView;

    iget-object v1, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menuListAdapter:Lcom/teewoo/app/bus/ui/SystemActivity$MenuListAdapter;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 57
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->menuListView:Landroid/widget/ListView;

    new-instance v1, Lcom/teewoo/app/bus/ui/SystemActivity$1;

    invoke-direct {v1, p0}, Lcom/teewoo/app/bus/ui/SystemActivity$1;-><init>(Lcom/teewoo/app/bus/ui/SystemActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 94
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/SystemActivity;->back:Landroid/view/View;

    new-instance v1, Lcom/teewoo/app/bus/ui/SystemActivity$2;

    invoke-direct {v1, p0}, Lcom/teewoo/app/bus/ui/SystemActivity$2;-><init>(Lcom/teewoo/app/bus/ui/SystemActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 100
    return-void
.end method
